package com.solcoo.customer.model;

import android.graphics.Bitmap;

import com.android.common.App;
import com.solcoo.customer.R;
import com.solcoo.customer.qrcode.Qrcode;

public class User extends BaseDO {
	public static final int MALE = 1;
	public static final int FEMALE = 2;

	public String shoujih;
	public String yonghum;
	public int xingbie = MALE;
	public String nicheng;
	public String touxiang;

	private Bitmap qrcode;

	public String getSexName() {
		return xingbie == MALE ? "男" : "女";
	}

	public int getSexResId() {
		return xingbie == MALE ? R.drawable.male_icon : R.drawable.female_icon;
	}

	public Bitmap getQrcode() {
		if (qrcode == null || qrcode.isRecycled()) {
			qrcode = Qrcode.create(shoujih, App.DISPLAY.SCREEN_WIDTH);
		}
		return qrcode;
	}
}
